package my.springboot.event;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan
public class Main {
	public static void main(String[] args) {
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Main.class);
		DemoPublisher publisher = context.getBean(DemoPublisher.class);
//		DemoPublisher publisher = new DemoPublisher();
		publisher.publish("一个事件");
		context.close();
	}
}
